package com.niodata.dp.mybatis.test;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {

  @Insert("insert into user(id,name,books) values(#{u.id},#{u.name},#{u.books})")
  public void saveUser(@Param("u") User user);

  @Select("select * from user")
  public List<User> getUsers();

  @Delete("delete from user")
  public void delete();
}
